
function copyHtml(selector) {
    var ele = document.getElementById(selector);
    if (window.getSelection) {
        var selection = window.getSelection();
        var range = document.createRange();
        range.selectNodeContents(ele);
        selection.removeAllRanges();
        selection.addRange(range);
    }
    document.execCommand("copy", false, null);
    selection.removeAllRanges();
}
